//
//  CGHelper.h
//  lnnipad
//
//  Created by Wu Wang on 11-11-22.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GameKit/GameKit.h"
#import "../Classes/IGCHelper.h"

// 如果希望在C++中捕获如下状态，需要在包含此文件的CPP文件中添加此函数的实现

@protocol GCHelperDelegate 
- (void)MatchStarted;
- (void)MatchEnded;
- (void)Match:(GKMatch *)match didReceiveData:(NSData *)data fromPlayer:(NSString *)playerID;
@end

@interface GCHelper : NSObject<GKLeaderboardViewControllerDelegate, GKMatchmakerViewControllerDelegate, GKMatchDelegate>
{
    BOOL m_bGCAvailable;
    BOOL m_bUserAuthenticated;
    
    UIViewController     *m_pMatchViewController;
    GKMatch              *m_pMatch;
    BOOL                  m_bMatchStarted;
    CGCMatchDelegate     *m_delegate;
    NSMutableDictionary  *m_dicPlayers;
}

@property (assign, readonly) BOOL        m_bGCAvailable;
@property (retain) UIViewController     *m_pMatchViewController;
@property (retain) GKMatch              *m_pMatch;
@property (retain) NSMutableDictionary  *m_dicPlayers;


+ (GCHelper *)ShareInstance;
- (void)AuthenticateLocalUser;
- (void)ShowLeaderboard;
- (BOOL)ReportScore:(int64_t)paramSocre:(NSString*)paramLeaderboard;
- (void)GetCenterScore;

- (void)FindMatchWithMinPlayers:(int)minPlayers maxPlayers:(int)maxPlayers viewController:(UIViewController *)viewController delegate:(CGCMatchDelegate *)theDelegate;
- (void)LookupMatchPlayers;

@end
